package helloworld.delegate.teacher;

import helloworld.exception.DuplicateTeacherException;
import helloworld.admin.bean.*;
import helloworld.admin.service.teacher.TeacherControllerService;
import helloworld.admin.service.teacher.TeacherServiceException;
/**
 *
 * @author Tuyen-DM 
 * @version $Revision:   $ $Date: 2009/05/13  $
 */
public class TeacherDelegate {

	public TeacherAdminBean getTeacherDetail(String teacherName) throws TeacherServiceException{
		TeacherControllerService teacherService = new TeacherControllerService();
		return teacherService.getTeacherDetail(teacherName);
	}
	
	public int createTeacher(TeacherAdminBean teacher)throws TeacherServiceException,DuplicateTeacherException{
		TeacherControllerService teacherService = new TeacherControllerService();
		return teacherService.createTeacher(teacher);
	}
	
	public void updateTeacher(TeacherAdminBean teacher)throws TeacherServiceException,DuplicateTeacherException{
		TeacherControllerService teacherService = new TeacherControllerService();
		teacherService.updateTeacher(teacher);
	}
	
	public void deleteTeacher(int id)throws TeacherServiceException{
		TeacherControllerService teacherService = new TeacherControllerService();
		teacherService.deleteTeacher(id);
	}
}
